package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxsx;
import cn.bj.beans.YxsxExample;
import cn.bj.dao.YxsxMapper;

@Service
public class YxsxService {
	@Autowired
	YxsxMapper yxsxMapper;

	// 查询所有
	public List<Yxsx> getAllYxhqWorkPicture() {
		YxsxExample yxsxExample = new YxsxExample();
		yxsxExample.setOrderByClause("`sort` DESC,id ASC");
		return yxsxMapper.selectByExample(yxsxExample);
	}

	// 新增
	public int insrtYxsx(Yxsx yxsx) {
		return yxsxMapper.insert(yxsx);
	}

	// 删除
	public int deleteYxsx(Integer id) {
		return yxsxMapper.deleteByPrimaryKey(id);
	}

	// 查询单个
	public Yxsx selectById(Integer id) {
		return yxsxMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateYxsx(Yxsx yxsx) {
		return yxsxMapper.updateByPrimaryKey(yxsx);
	}

}
